<!--
/**
 * @file Rules_Actions.html
 * @author Alejandro Dario Simi
 * @date $Date: 2013-01-01 04:40:44 +0000 (Tue, 01 Jan 2013) $
 *
 * $Id: Rules_Actions.html 48 2013-01-01 04:40:44Z daemonraco@gmail.com $
 * $URL: http://wcomix.googlecode.com/svn/tags/wcomix-1.0-BETA1/docs/Rules_Actions.html $
 */
-->
<html>
	<head>
		<title>Rules &amp; Actions</title>
		<link rel="stylesheet" type="text/css" href="docs.css"/>
		<script type="text/javascript" src="jquery-1.8.0.min.js"></script>
		<script type="text/javascript" src="docs.js"></script>
	</head>
	<body>
		<div class="Section">
			<span class="Title">Table Of Contents</span>
			<div class="TableOfContents"></div>
		</div>
		<div class="Section">
			<span class="Title">Rules</span>
			<div class="Paragraph">
				<p>A rule is a list of actions to be taken based on some characteristic of a comic. For example, if a comic is tag with "Rei Ayanami", it
				could be useful to automatically tag it with others like "Neon Genesis Evangelion", " Gainax" and also "Hideaki Anno".</p>
				<p>This kind of behavior can be seen as a single rule, perhaps called "Neon Genesis Evangelion" with three action, one per each tag to be
				added automatically.</p>
			</div>
		</div>
		<div class="Section">
			<span class="Title">Actions</span>
			<div class="Paragraph">
				<p>Actions are a bit more complex concept, and this is because wcomix knows how to use an generic type of action which is not useful for
				any rule. Therefore, this generic type of action must me specified and implemented in the right way.</p>
				<p>@TODO</p>
			</div>
		</div>
		<div class="Section">
			<span class="Title">Actions Hooks</span>
			<div class="Paragraph">
				<p>wcomix porovides a global array containing hooks to use actions. This hook is called
					[VA:$wcRuleHooks] and every element in it must be an associative array
					with this positions:</p>
				<p><ul>
					<li><label>name</label>: Action name.</li>
					<li><label>description</label>:	Short description for this kind of action.</li>
					<li><label>class</label>: This should be a the name of the class used to manage
						this kind of actions. It must inherit from [CL:RuleAction].</li>
					<li><label>page</label>: This must be a full path to a PHP file. This file must
						contain a piece of page to be used to show action of certain type.<br/>
						Such page must provide all needed tools to manage actions.</li>
					<li><label>conficts</label>: This is an optional field and it can be used for
						@TODO</li>
				</ul></p>
			</div>
		</div>
		<div class="Section">
			<span class="Title">Actions Main Class</span>
			<div class="Paragraph">
				<p>All rules actions are represented by a class called [CL:RuleAction] which
					provides an abstract specification of an action.</p>
			</div>
			<span class="SubTitle">Methods</span>
			<div class="Paragraph">
				<p>This abstract class provides the next list of methods:</p>
				<p><ul>
					<li><label>Public</label><ul>
						<li><label>[ME:__construct([VA:$id], [VA:$group]=[CO:DEFAULT_TAG_GROUP])]</label>: @TODO</li>
						<li><label>[ME:group()]</label>: Returns the group in which this action applies.</li>
						<li><label>[ME:id()]</label>: Returns the id asign to the an action in the table [TA:*_rul_actions].</li>
						<li><label>[ME:isOk()]</label>: By defalt this method returns [CO:false] unless a subclass changes the value of
							[CL:$this]->[VA:_ok]. When it's [CO:true], it can be applied.</li>
						<li><label>[ME:name()]</label>: By default it has the same value than [VA:id()] unless a subclass sets
							[CL:$this]->[VA:_name].</li>
						<li><label>[ME:remove()]</label>: This method is called when the action is been removed.</li>
						<li><label>[AB:[ME:run()]]</label>: This method is called every time the action must be applied and it must be
							reimplemented by the subclass.</li>
						<li><label>[ME:type()]</label>: Returns a numeric value representing the action type.</li>
					</ul></li>
					<li><label>Protected</label><ul>
						<li><label>[AB:[ME:load()]]</label>: @TODO</li>
						<li><label>[AB:[ME:removeSpecific()]]</label>: @TODO</li>
					</ul></li>
				</ul></p>
			</div>
			<span class="SubTitle">Variables</span>
			<div class="Paragraph">
				<p>This abstract class provides the next list of methods:</p>
			</div>
		</div>
		<div class="Section">
			<span class="Title">Default Actions</span>
			<div class="Paragraph">
				<p>By default, wcomix provides a few types of actions which allows to create rules with some basic actions like automatic tags for other
				tags and movings comix with certain tag to an specific directory.</p>
				<p>@todo</p>
			</div>
			<span class="SubTitle">Add Also Action</span>
			<div class="Paragraph">
				<p>This kind of action seeks for every element with an specific tag and try to add other tags.</p>
				<p>@todo</p>
			</div>
		</div>
	</body>
</html>